package com.ruoyi.sqlserver.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.sqlserver.domain.PesCompany;
import com.ruoyi.sqlserver.mapper.PesCompanyMapper;
import com.ruoyi.sqlserver.service.IPesCompanyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * pesService业务层处理
 *
 * @author wkw
 * @date 2024-04-14
 */
@Service
@DataSource(value = DataSourceType.SLAVE)
public class PesCompanyServiceImpl implements IPesCompanyService
{
    @Autowired
    private PesCompanyMapper pesCompanyMapper;

    /**
     * 查询pes
     *
     * @param coId pes主键
     * @return pes
     */
    @Override
    public PesCompany selectPesCompanyByCoId(String coId)
    {
        return pesCompanyMapper.selectPesCompanyByCoId(coId);
    }

    /**
     * 查询pes列表
     *
     * @param pesCompany pes
     * @return pes
     */
    @Override
    public List<PesCompany> selectPesCompanyList(PesCompany pesCompany)
    {
        List<PesCompany> pesCompanies = pesCompanyMapper.selectPesCompanyList(pesCompany);
        return pesCompanies;
    }

    /**
     * 新增pes
     *
     * @param pesCompany pes
     * @return 结果
     */
    @Override
    public int insertPesCompany(PesCompany pesCompany)
    {
        pesCompany.setCreateTime(DateUtils.getNowDate());
        return pesCompanyMapper.insertPesCompany(pesCompany);
    }

    /**
     * 修改pes
     *
     * @param pesCompany pes
     * @return 结果
     */
    @Override
    public int updatePesCompany(PesCompany pesCompany)
    {
        return pesCompanyMapper.updatePesCompany(pesCompany);
    }

    /**
     * 批量删除pes
     *
     * @param coIds 需要删除的pes主键
     * @return 结果
     */
    @Override
    public int deletePesCompanyByCoIds(String[] coIds)
    {
        return pesCompanyMapper.deletePesCompanyByCoIds(coIds);
    }

    /**
     * 删除pes信息
     *
     * @param coId pes主键
     * @return 结果
     */
    @Override
    public int deletePesCompanyByCoId(String coId)
    {
        return pesCompanyMapper.deletePesCompanyByCoId(coId);
    }
}
